package com.autumn.security.user;

import com.autumn.security.AutumnAccountCredentialsException;
import com.autumn.security.auth.AutumnAuthenticationToken;

/**
 * 用户认证服务
 * 
 * @author 老码农
 *
 *         2017-11-04 15:14:28
 */
public interface IAutumnUserCredentialsService {

	/**
	 * 根据用户票据加载用户
	 * 
	 * @param token
	 *            登录票据
	 * @throws AutumnAccountCredentialsException
	 *             认证无效而引发的异常
	 */
	IAutumnUser loadUserByToken(AutumnAuthenticationToken token) throws AutumnAccountCredentialsException;

	/**
	 * 账户认证匹配结果
	 * 
	 * @param token
	 *            票据
	 * @param user
	 *            用户
	 * @param isMatch
	 *            是否匹配
	 */
	void credentiaMatchResult(AutumnAuthenticationToken token, IAutumnUser user, boolean isMatch);

}
